#ifndef COROUTINE_THREAD_H
#define COROUTINE_THREAD_H

#include "../base/Defind.hpp"

#include <cstdlib>
#include <string>
#include <sys/types.h>
#include <thread>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>

namespace DBServer {
namespace coroutine {


class Thread {
public:
    DISABLE_CONSTUCTOR(Thread);

    static auto ThreadName() -> std::string &;

    static auto ThreadId() -> pid_t ;

    static void MainThread();

    template<typename Func>
    static auto CreatThread(Func func) -> std::thread {
        set_name();
        set_id();
        return std::thread(func);
    }

private:

    static void set_name();
    static void set_id();
};

}   // coroutine   
}   // DBServer

#endif // !COROUTINE_THREAD_H